/*
 * @(#)DocumentEntry.java
 * Date 2013-04-08
 * Version 1.0
 * Author Jim Horner
 * Copyright (c)2012
 */


package us.hornerscorners.lamppost.model.document;

import java.util.ArrayList;
import java.util.List;

import org.codehaus.jackson.annotate.JsonIgnoreProperties;

import org.codehaus.jackson.map.annotate.JsonDeserialize;
import org.codehaus.jackson.map.annotate.JsonSerialize;

import org.joda.time.DateTime;

import us.hornerscorners.lamppost.model.DateTimeJsonDeserializer;
import us.hornerscorners.lamppost.model.DateTimeJsonSerializer;

import us.hornerscorners.lamppost.model.common.AbstractPersistableModel;
import us.hornerscorners.lamppost.model.common.CodedElement;
import us.hornerscorners.lamppost.model.common.InstanceIdentifier;
import us.hornerscorners.lamppost.model.common.PersistableModelType;
import us.hornerscorners.lamppost.model.common.TimeInterval;


/**
 *
 * @author jim
 */
@JsonIgnoreProperties(ignoreUnknown = true)
public class DocumentEntry extends AbstractPersistableModel implements IAssociable {

    /** Field description */
    private final List<Author> authors;

    /** Field description */
    private CodedElement availabilityStatus;

    /** Field description */
    private CodedElement classCode;

    /** Field description */
    private final List<CodedElement> confidentialityCodes;

    /** Field description */
    @JsonSerialize(using = DateTimeJsonSerializer.class)
    @JsonDeserialize(using = DateTimeJsonDeserializer.class)
    private DateTime creationTime;

    /** Field description */
    private DocumentType documentType;

    /** Field description */
    private final List<CodedElement> eventCodes;

    /** Field description */
    private final List<Attribute> extraAttributes;

    /** Field description */
    private final List<Association> folders;

    /** Field description */
    private CodedElement formatCode;

    /** Field description */
    private String hash;

    /** Field description */
    private CodedElement healthcareFacilityTypeCode;

    /** Field description */
    private String languageCode;

    /** Field description */
    private String legalAuthenticator;

    /** Field description */
    private String mimeType;

    /** Field description */
    private Association parentDocument;

    /** Field description */
    private InstanceIdentifier patientId;

    /** Field description */
    private CodedElement practiceSettingCode;

    /** Field description */
    private String repositoryId;

    /** Field description */
    private TimeInterval serviceInterval;

    /** Field description */
    private String size;

    /** Field description */
    private InstanceIdentifier sourcePatientId;

    /** Field description */
    private final List<String> sourcePatientInfo;

    /** Field description */
    private final List<Association> submissionSets;

    /** Field description */
    private CodedElement typeCode;

    /** Field description */
    private InstanceIdentifier uniqueId;

    /** Field description */
    private String uri;

    /**
     * Constructs ...
     *
     */
    public DocumentEntry() {

        super(PersistableModelType.DocumentEntry);

        this.documentType = DocumentType.Original;
        
        this.authors = new ArrayList<>();
        this.confidentialityCodes = new ArrayList<>();
        this.eventCodes = new ArrayList<>();
        this.extraAttributes = new ArrayList<>();
        this.folders = new ArrayList<>();
        this.sourcePatientInfo = new ArrayList<>();
        this.submissionSets = new ArrayList<>();
    }

    /**
     * Method description
     *
     *
     * @return
     */
    public List<Author> getAuthors() {
        return authors;
    }

    /**
     * Method description
     *
     *
     * @return
     */
    public CodedElement getAvailabilityStatus() {
        return availabilityStatus;
    }

    /**
     * Method description
     *
     *
     * @return
     */
    public CodedElement getClassCode() {
        return classCode;
    }

    /**
     * Method description
     *
     *
     * @return
     */
    public List<CodedElement> getConfidentialityCodes() {
        return confidentialityCodes;
    }

    /**
     * Method description
     *
     *
     * @return
     */
    public DateTime getCreationTime() {
        return creationTime;
    }

    /**
     * Method description
     *
     *
     * @return
     */
    public DocumentType getDocumentType() {
        return documentType;
    }

    /**
     * Method description
     *
     *
     * @return
     */
    public List<CodedElement> getEventCodes() {
        return eventCodes;
    }

    /**
     * Method description
     *
     *
     * @return
     */
    public List<Attribute> getExtraAttributes() {
        return extraAttributes;
    }

    /**
     * Method description
     *
     *
     * @return
     */
    public List<Association> getFolders() {
        return folders;
    }

    /**
     * Method description
     *
     *
     * @return
     */
    public CodedElement getFormatCode() {
        return formatCode;
    }

    /**
     * Method description
     *
     *
     * @return
     */
    public String getHash() {
        return hash;
    }

    /**
     * Method description
     *
     *
     * @return
     */
    public CodedElement getHealthcareFacilityTypeCode() {
        return healthcareFacilityTypeCode;
    }

    /**
     * Method description
     *
     *
     * @return
     */
    public String getLanguageCode() {
        return languageCode;
    }

    /**
     * Method description
     *
     *
     * @return
     */
    public String getLegalAuthenticator() {
        return legalAuthenticator;
    }

    /**
     * Method description
     *
     *
     * @return
     */
    public String getMimeType() {
        return mimeType;
    }

    /**
     * Method description
     *
     *
     * @return
     */
    public Association getParentDocument() {
        return parentDocument;
    }

    /**
     * Method description
     *
     *
     * @return
     */
    @Override
    public InstanceIdentifier getPatientId() {
        return patientId;
    }

    /**
     * Method description
     *
     *
     * @return
     */
    public CodedElement getPracticeSettingCode() {
        return practiceSettingCode;
    }

    /**
     * Method description
     *
     *
     * @return
     */
    public String getRepositoryId() {
        return repositoryId;
    }

    /**
     * Method description
     *
     *
     * @return
     */
    public TimeInterval getServiceInterval() {
        return serviceInterval;
    }

    /**
     * Method description
     *
     *
     * @return
     */
    public String getSize() {
        return size;
    }

    /**
     * Method description
     *
     *
     * @return
     */
    public InstanceIdentifier getSourcePatientId() {
        return sourcePatientId;
    }

    /**
     * Method description
     *
     *
     * @return
     */
    public List<String> getSourcePatientInfo() {
        return sourcePatientInfo;
    }

    /**
     * Method description
     *
     *
     * @return
     */
    public List<Association> getSubmissionSets() {
        return submissionSets;
    }

    /**
     * Method description
     *
     *
     * @return
     */
    public CodedElement getTypeCode() {
        return typeCode;
    }

    /**
     * Method description
     *
     *
     * @return
     */
    @Override
    public InstanceIdentifier getUniqueId() {
        return uniqueId;
    }

    /**
     * Method description
     *
     *
     * @return
     */
    public String getUri() {
        return uri;
    }

    /**
     * Method description
     *
     *
     * @param availabilityStatus
     */
    public void setAvailabilityStatus(CodedElement availabilityStatus) {
        this.availabilityStatus = availabilityStatus;
    }

    /**
     * Method description
     *
     *
     * @param classCode
     */
    public void setClassCode(CodedElement classCode) {
        this.classCode = classCode;
    }

    /**
     * Method description
     *
     *
     * @param creationTime
     */
    public void setCreationTime(DateTime creationTime) {
        this.creationTime = creationTime;
    }

    /**
     * Method description
     *
     *
     * @param documentType
     */
    public void setDocumentType(DocumentType documentType) {
        this.documentType = documentType;
    }

    /**
     * Method description
     *
     *
     * @param formatCode
     */
    public void setFormatCode(CodedElement formatCode) {
        this.formatCode = formatCode;
    }

    /**
     * Method description
     *
     *
     * @param hash
     */
    public void setHash(String hash) {
        this.hash = hash;
    }

    /**
     * Method description
     *
     *
     * @param healthcareFacilityTypeCode
     */
    public void setHealthcareFacilityTypeCode(CodedElement healthcareFacilityTypeCode) {
        this.healthcareFacilityTypeCode = healthcareFacilityTypeCode;
    }

    /**
     * Method description
     *
     *
     * @param languageCode
     */
    public void setLanguageCode(String languageCode) {
        this.languageCode = languageCode;
    }

    /**
     * Method description
     *
     *
     * @param legalAuthenticator
     */
    public void setLegalAuthenticator(String legalAuthenticator) {
        this.legalAuthenticator = legalAuthenticator;
    }

    /**
     * Method description
     *
     *
     * @param mimeType
     */
    public void setMimeType(String mimeType) {
        this.mimeType = mimeType;
    }

    /**
     * Method description
     *
     *
     * @param parentDocument
     */
    public void setParentDocument(Association parentDocument) {
        this.parentDocument = parentDocument;
    }

    /**
     * Method description
     *
     *
     * @param patientId
     */
    public void setPatientId(InstanceIdentifier patientId) {
        this.patientId = patientId;
    }

    /**
     * Method description
     *
     *
     * @param practiceSettingCode
     */
    public void setPracticeSettingCode(CodedElement practiceSettingCode) {
        this.practiceSettingCode = practiceSettingCode;
    }

    /**
     * Method description
     *
     *
     * @param repositoryId
     */
    public void setRepositoryId(String repositoryId) {
        this.repositoryId = repositoryId;
    }

    /**
     * Method description
     *
     *
     * @param serviceInterval
     */
    public void setServiceInterval(TimeInterval serviceInterval) {
        this.serviceInterval = serviceInterval;
    }

    /**
     * Method description
     *
     *
     * @param size
     */
    public void setSize(String size) {
        this.size = size;
    }

    /**
     * Method description
     *
     *
     * @param sourcePatientId
     */
    public void setSourcePatientId(InstanceIdentifier sourcePatientId) {
        this.sourcePatientId = sourcePatientId;
    }

    /**
     * Method description
     *
     *
     * @param typeCode
     */
    public void setTypeCode(CodedElement typeCode) {
        this.typeCode = typeCode;
    }

    /**
     * Method description
     *
     *
     * @param uniqueId
     */
    public void setUniqueId(InstanceIdentifier uniqueId) {
        this.uniqueId = uniqueId;
    }

    /**
     * Method description
     *
     *
     * @param uri
     */
    public void setUri(String uri) {
        this.uri = uri;
    }
}
